package com.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.xiaobaibai.valid.AddGroup;
import com.xiaobaibai.valid.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author xiaobaibai
 * @since 2020-11-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("bargain_product")
@ApiModel(value="BargainProduct对象", description="")
public class BargainProduct implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "砍价表id")
    @TableId(value = "id", type = IdType.AUTO)
    @Null(message = "新增不可指定id",groups = AddGroup.class)
    @NotNull(message = "修改需指定id",groups = UpdateGroup.class)
    private Integer id;

    @ApiModelProperty(value = "商品id")
    @TableField("product_id")
    @NotNull(message = "请指定商品id",groups = AddGroup.class)
    private Integer productId;

    @ApiModelProperty(value = "砍价一次的进度大小")
    @TableField("bargain_unit")
    @NotNull(message = "请设置砍价单位",groups = AddGroup.class)
    @Max(value = 100,message = "单位最大为100")
    private Integer bargainUnit;

    @ApiModelProperty(value = "新用户的进度单位")
    @TableField("bargain_new_unit")
    @NotNull(message = "请设置新用户砍价单位",groups = AddGroup.class)
    @Max(value = 100,message = "单位最大为100")
    private Integer bargainNewUnit;

    @ApiModelProperty(value = "是否生效")
    @TableField("status")
    @NotNull(message = "是否立即生效",groups = AddGroup.class)
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


}
